<include file="Public:head"/>
<link rel="stylesheet" href="{lanrain::STATICS}/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="{lanrain::STATICS}/kindeditor/plugins/code/prettify.css" />
<link rel="stylesheet" type="text/css" href="{lanrain::RES}/css/cymain.css" />
<script src="/tpl/static/artDialog/jquery.artDialog.js?skin=default"></script>
<script src="/tpl/static/artDialog/plugins/iframeTools.js"></script>
<script src="{lanrain::STATICS}/kindeditor/kindeditor.js" type="text/javascript"></script>
<script src="{lanrain::STATICS}/kindeditor/lang/zh_CN.js" type="text/javascript"></script>
<script src="{lanrain::STATICS}/kindeditor/plugins/code/prettify.js" type="text/javascript"></script>
<script src="{lanrain::RES}/js/date/WdatePicker.js"></script>
<script type="text/javascript" src="{lanrain::RES}/js/formCheck/formcheck.js"> </script>
<script>
	KindEditor.ready(function(K){
		var editor = K.editor({
			allowFileManager:true
		});
		K('#upload_pic').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					fileUrl : K('#pic').val(),
					clickFn : function(url, title) {
						if(url.indexOf("http") > -1){
							K('#pic').val(url);
						}else{
							K('#pic').val("{lanrain::C('site_url')}"+url);
						}
						editor.hideDialog();
					}
				});
			});
		});
		K('#upload_opening_animation').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					fileUrl : K('#opening_animation').val(),
					clickFn : function(url, title) {
						if(url.indexOf("http") > -1){
							K('#opening_animation').val(url);
						}else{
							K('#opening_animation').val("{lanrain::C('site_url')}"+url);
						}
						editor.hideDialog();
					}
				});
			});
		});
		K('#upload_small_pic').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					fileUrl : K('#small_pic').val(),
					clickFn : function(url, title) {
						if(url.indexOf("http") > -1){
							K('#small_pic').val(url);
						}else{
							K('#small_pic').val("{lanrain::C('site_url')}"+url);
						}
						editor.hideDialog();
					}
				});
			});
		});
		K('#upload_site_map_1').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					fileUrl : K('#site_map_1').val(),
					clickFn : function(url, title) {
						if(url.indexOf("http") > -1){
							K('#site_map_1').val(url);
						}else{
							K('#site_map_1').val("{lanrain::C('site_url')}"+url);
						}
						editor.hideDialog();
					}
				});
			});
		});
		K('#upload_site_map_2').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					fileUrl : K('#site_map_2').val(),
					clickFn : function(url, title) {
						if(url.indexOf("http") > -1){
							K('#site_map_2').val(url);
						}else{
							K('#site_map_2').val("{lanrain::C('site_url')}"+url);
						}
						editor.hideDialog();
					}
				});
			});
		});
		K('#upload_site_map_3').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					fileUrl : K('#site_map_3').val(),
					clickFn : function(url, title) {
						if(url.indexOf("http") > -1){
							K('#site_map_3').val(url);
						}else{
							K('#site_map_3').val("{lanrain::C('site_url')}"+url);
						}
						editor.hideDialog();
					}
				});
			});
		});
		K('#upload_site_map_4').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					fileUrl : K('#site_map_4').val(),
					clickFn : function(url, title) {
						if(url.indexOf("http") > -1){
							K('#site_map_4').val(url);
						}else{
							K('#site_map_4').val("{lanrain::C('site_url')}"+url);
						}
						editor.hideDialog();
					}
				});
			});
		});
		K('#upload_site_map_5').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					fileUrl : K('#site_map_5').val(),
					clickFn : function(url, title) {
						if(url.indexOf("http") > -1){
							K('#site_map_5').val(url);
						}else{
							K('#site_map_5').val("{lanrain::C('site_url')}"+url);
						}
						editor.hideDialog();
					}
				});
			});
		});
	});
</script>

<script>

var editor;
KindEditor.ready(function(K) {
editor = K.create('#text-content', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
items : [
'source','undo','clearhtml','hr',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image','link', 'unlink','baidumap','lineheight','table','anchor','preview','print','template','code','cut']
});

});
</script>
<script>
function selectall(name) {
	var checkItems=$('.cbitem');
	if ($("#check_box").attr('checked')==false) {
		$.each(checkItems, function(i,val){
			val.checked=false;
		});
		
	} else {
		$.each(checkItems, function(i,val){
			val.checked=true;
		});
	}
}
function setlatlng(longitude,latitude){
	art.dialog.data('longitude', longitude);
	art.dialog.data('latitude', latitude);
	// 此时 iframeA.html 页面可以使用 art.dialog.data('test') 获取到数据，如：
	// document.getElementById('aInput').value = art.dialog.data('test');
	art.dialog.open('{lanrain::U('Map/setLatLng',array('token'=>$token,'id'=>$id))}',{lock:false,title:'设置经纬度',width:600,height:400,yesText:'关闭',background: '#000',opacity: 0.87});
}
</script>
<div class="content" style="width:920px; background:none; margin-left:275px; border:none; margin-bottom:30px;" >
   <div class="cLineB"> 
    <h4>喜帖设置</h4> 
    <a href="{lanrain::U('Xitie/index',array('token'=>$token))}" class="right  btnGreen" style="margin-top:-27px">返回</a> 
   </div> 

   <form class="form" method="post" id="form" action="" enctype="multipart/form-data"> 
<if condition="$isUpdate eq 1">
<input type="hidden" name="id" value="{lanrain:$set.id}" />
</if>
    <div class="msgWrap bgfc"> 
     <table class="userinfoArea" style=" margin:0;" border="0" cellspacing="0" cellpadding="0" width="100%"> 
      <tbody> 
     <tr> 
        <th><span class="red">*</span>标题：</th> 
        <td><input type="text" id="name" name="title" value="{lanrain:$set.title}" class="px require" style="width:400px;" /></td> 
       </tr> 
     <tr> 
        <th><span class="red">*</span>关键词：</th>
        <td><input type="text" name="keyword" id="keyword" value="{lanrain:$set.keyword}" class="px" style="width:400px;" /></td> 
       </tr>
     <tr> 
        <th><span class="red"></span>封面（图片）：</th> 
        <td><input type="text" name="pic" value="{lanrain:$set.pic}" id="pic" class="px" style="width:400px;"  readonly="readonly"/><span class="ke-button-common" id="upload_pic" style="margin-top: 3px;margin-left: 5px;"><input type="button" class="ke-button-common ke-button" value="上传"></span></td> 
       </tr>
     <tr> 
        <th><span class="red"></span>开场动画(图片gif)：</th>
        <td><input type="text" name="opening_animation" value="{lanrain:$set.opening_animation}" id="opening_animation" class="px" style="width:400px;"  readonly="readonly"/><span class="ke-button-common" id="upload_opening_animation" style="margin-top: 3px;margin-left: 5px;"><input type="button" class="ke-button-common ke-button" value="上传"></span></td> 
       </tr>
	   <tr> 
        <th><span class="red"></span>小图：</th>
        <td><input type="text" name="small_pic" value="{lanrain:$set.small_pic}" id="small_pic" class="px" style="width:400px;"  readonly="readonly"/><span class="ke-button-common" id="upload_small_pic" style="margin-top: 3px;margin-left: 5px;"><input type="button" class="ke-button-common ke-button" value="上传"></span></td> 
       </tr>
     <tr> 
        <th><span class="red">*</span>男方名：</th>
        <td><input type="text" name="man_name" value="{lanrain:$set.man_name}" class="px" style="width:400px;" /></td> 
       </tr>
     <tr> 
        <th><span class="red">*</span>女方名：</th>
        <td><input type="text" name="girl_name" value="{lanrain:$set.girl_name}" class="px" style="width:400px;" /></td> 
       </tr>
	   <tr> 
        <th><span class="red">*</span>电话号：</th>
        <td><input type="text" name="phone" value="{lanrain:$set.phone}" class="px" style="width:400px;" /></td> 
       </tr>
	   <tr> 
        <th><span class="red"></span>宴会时间：</th>
        <td><input type="text" name="time" value="{lanrain:$set.time}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" autocomplete="off" class="px" style="width:400px;" /></td> 
       </tr>
     <tr> 
        <th><span class="red"></span>地址：</th>
        <td><input type="text" name="address" value="{lanrain:$set.address}" class="px" style="width:400px;" /></td> 
       </tr>
	   <tr> 
        <th><span class="red">*</span>经纬度：</th> 
        <td>经度 <input type="text" id="longitude"  name="longitude" size="14" class="px" value="{lanrain:$set.longitude}" /> 纬度 <input type="text"  name="latitude" size="14" id="latitude" class="px" value="{lanrain:$set.latitude}" /> <a href="###" onclick="setlatlng($('#longitude').val(),$('#latitude').val())">在地图中查看/设置</a></td> 
       </tr>
	   <tr>
	   <th><span class="red"></span>视频：</th>
        <td><input type="text" name="video" value="{lanrain:$set.video}" class="px" style="width:400px;" />&nbsp;&nbsp;<span class="red">请填写外链地址</span></td> 
       </tr>
	   <tr>
	   <th><span class="red"></span>背景音乐：</th>
        <td><input type="text" name="background_music" value="{lanrain:$set.background_music}" class="px" style="width:400px;" />&nbsp;&nbsp;<span class="red">请填写外链地址</span></td> 
       </tr>
	   <tr> 
        <th><span class="red"></span>场地图(一)：</th>
        <td><input type="text" name="site_map_1" value="{lanrain:$set.site_map_1}" id="site_map_1" class="px" style="width:400px;"  readonly="readonly"/><span class="ke-button-common" id="upload_site_map_1" style="margin-top: 3px;margin-left: 5px;"><input type="button" class="ke-button-common ke-button" value="上传"></span></td> 
       </tr>
	   <tr> 
        <th><span class="red"></span>场地图(二)：</th>
        <td><input type="text" name="site_map_2" value="{lanrain:$set.site_map_2}" id="site_map_2" class="px" style="width:400px;"  readonly="readonly"/><span class="ke-button-common" id="upload_site_map_2" style="margin-top: 3px;margin-left: 5px;"><input type="button" class="ke-button-common ke-button" value="上传"></span></td> 
       </tr>
	   <tr> 
        <th><span class="red"></span>场地图(三)：</th>
        <td><input type="text" name="site_map_3" value="{lanrain:$set.site_map_3}" id="site_map_3" class="px" style="width:400px;"  readonly="readonly"/><span class="ke-button-common" id="upload_site_map_3" style="margin-top: 3px;margin-left: 5px;"><input type="button" class="ke-button-common ke-button" value="上传"></span></td> 
       </tr>
	   <tr> 
        <th><span class="red"></span>场地图(四)：</th>
        <td><input type="text" name="site_map_4" value="{lanrain:$set.site_map_4}" id="site_map_4" class="px" style="width:400px;"  readonly="readonly"/><span class="ke-button-common" id="upload_site_map_4" style="margin-top: 3px;margin-left: 5px;"><input type="button" class="ke-button-common ke-button" value="上传"></span></td> 
       </tr>
	   <tr> 
        <th><span class="red"></span>场地图(五)：</th>
        <td><input type="text" name="site_map_5" value="{lanrain:$set.site_map_5}" id="site_map_5" class="px" style="width:400px;"  readonly="readonly"/><span class="ke-button-common" id="upload_site_map_5" style="margin-top: 3px;margin-left: 5px;"><input type="button" class="ke-button-common ke-button" value="上传"></span></td> 
       </tr>
     <tr>
			<th valign="top"><label for="info">详细内容：</label></th>
            <td><textarea name="message"  id="text-content" rows="5" style="width:590px;height:360px">{lanrain:$set.message}</textarea></td>
        </tr>  
     <tr>         
       <th>&nbsp;</th>
       <td>
		<!--input type="hidden" name="time" value="{lanrain:$set.time}" /-->
       <button type="submit" name="button" class="btnGreen">保存</button> &nbsp; <a href="{lanrain::U('Xitie/add',array('token'=>$token))}" class="btnGray vm">取消</a></td> 
       </tr> 
      </tbody> 
     </table> 
     </div>
    
   </form> 
  </div> 
<script language="javascript">
$(function(){
	$("#form").valid([
	{ name:"name",simple:"名称",require:true},
	{ name:"keyword",simple:"关键词",require:true}
		
	],true,true);

})
</script>
  <include file="Public:footer" />